import {defineStore} from 'pinia'
import {ref} from 'vue'
//第一个参数是状态名字，第二个参数是定义状态相关内容
const useUserInfoStore = defineStore('userInfo',()=>{
        //定义状态相关的内容
        const info = ref({});//响应式数据
        const setInfo = (newusername)=>{
            info.value=newusername;
        }
        const removeInfo = ()=>{
            info.value = {}
        }
        return {info,setInfo,removeInfo}
    },
    {persist:true})
export default useUserInfoStore;